/*
 * Powered By [pkuWx]
 * Web Site: http://www.wuxi.ss.pku.edu.cn
 * Since 2015 - 2015
 */

package cn.edu.pku.wxlib.message.model;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import cn.org.rapid_framework.util.DateConvertUtils;

import java.util.*;

import cn.edu.pku.wxlib.message.model.*;
import cn.edu.pku.wxlib.message.service.*;
import cn.edu.pku.wxlib.message.vo.query.*;

import javacommon.base.*;
import javacommon.util.*;
import javacommon.page.Page;

/**
 * @version 1.0
 * @since 1.0
 */


public class Message extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "Message";
	public static final String ALIAS_MESSAGE_ID = "messageId";
	public static final String ALIAS_RECEIVER_ID = "userId";
	public static final String ALIAS_SENDER_ID = "userId";
	public static final String ALIAS_CONTENT = "content";
	public static final String ALIAS_STATE = "1存在，0失效";
	
	//date formats
	
	//columns START
    /** messageId       db_column: messageId */	
	
	private java.lang.Integer messageId;
    /** userId       db_column: receiverId */	
	@NotNull 
	private java.lang.Integer receiverId;
    /** userId       db_column: senderId */	
	@NotNull 
	private java.lang.Integer senderId;
    /** content       db_column: content */	
	@Length(max=256)
	private java.lang.String content;
    /** 1存在，0失效       db_column: state */	
	
	private java.lang.Integer state;
	//columns END

	public Message(){
	}

	public Message(
		java.lang.Integer messageId
	){
		this.messageId = messageId;
	}

	public void setMessageId(java.lang.Integer value) {
		this.messageId = value;
	}
	
	public java.lang.Integer getMessageId() {
		return this.messageId;
	}
	public void setReceiverId(java.lang.Integer value) {
		this.receiverId = value;
	}
	
	public java.lang.Integer getReceiverId() {
		return this.receiverId;
	}
	public void setSenderId(java.lang.Integer value) {
		this.senderId = value;
	}
	
	public java.lang.Integer getSenderId() {
		return this.senderId;
	}
	public void setContent(java.lang.String value) {
		this.content = value;
	}
	
	public java.lang.String getContent() {
		return this.content;
	}
	public void setState(java.lang.Integer value) {
		this.state = value;
	}
	
	public java.lang.Integer getState() {
		return this.state;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("MessageId",getMessageId())
			.append("ReceiverId",getReceiverId())
			.append("SenderId",getSenderId())
			.append("Content",getContent())
			.append("State",getState())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getMessageId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof Message == false) return false;
		if(this == obj) return true;
		Message other = (Message)obj;
		return new EqualsBuilder()
			.append(getMessageId(),other.getMessageId())
			.isEquals();
	}
}

